﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using YServer;

public abstract class AbsOnceSendHandler
{
    public byte type;

    public abstract void SetProType();

    public byte GetProType() { return type; }

    public int area=0;

    public int GetArea() { return area; }

    public void Send(YToken token,int command) {
        Send(token, GetArea(), command);
    }
    public void Send(YToken token,int area,int command) {
        Send(token, GetProType(), area, command);
    }
    public void Send(YToken token, byte type, int area, int command)
    {
        Send(token, type,area,command,null);
    }
    public void Send(YToken token, byte type,int area,int command,object transModel)
    {
        SocketModel model = new SocketModel(type, area, command, transModel);
        Send(token, model);
    }
    public void Send(YToken token,SocketModel model) {
        token.Send(model);
    }
}
